/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/


#include "stdafx.h"
#include <pgl/core/PGLMapPropPage.h>
#include <pgl/core/PGLRegion.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPGLMapPropPage dialog


CPGLMapPropPage::CPGLMapPropPage(CPGLMapStPtr pMap)
	: CPropertyPage(CPGLMapPropPage::IDD)
{
	//{{AFX_DATA_INIT(CPGLMapPropPage)
	m_dDx = 0.0;
	m_dDy = 0.0;
	m_iNx = 0;
	m_iNxNy = 0;
	m_iNy = 0;
	m_dLeft = 0.0;
	m_dTop = 0.0;
	//}}AFX_DATA_INIT

	m_pMap=pMap;
}


void CPGLMapPropPage::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPGLMapPropPage)
	DDX_Text(pDX, IDC_PGL_EDIT_DX, m_dDx);
	DDX_Text(pDX, IDC_PGL_EDIT_DY, m_dDy);
	DDX_Text(pDX, IDC_PGL_EDIT_NX, m_iNx);
	DDX_Text(pDX, IDC_PGL_EDIT_NXTIMSNY, m_iNxNy);
	DDX_Text(pDX, IDC_PGL_EDIT_NY, m_iNy);
	DDX_Text(pDX, IDC_PGL_EDIT_LEFT, m_dLeft);
	DDX_Text(pDX, IDC_PGL_EDIT_TOP, m_dTop);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPGLMapPropPage, CPropertyPage)
	//{{AFX_MSG_MAP(CPGLMapPropPage)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPGLMapPropPage message handlers

BOOL CPGLMapPropPage::OnKillActive() 
{

	UpdateData(TRUE);
	// retreiving info	
	PGL_ASSERT_VALID(m_pMap);
	
	return CPropertyPage::OnKillActive();
}

BOOL CPGLMapPropPage::OnSetActive() 
{
	PGL_ASSERT_VALID(m_pMap);

	UpdateData(FALSE);
	
	return CPropertyPage::OnSetActive();
}
